package src.com.java.dtgh.oneDay;

public class demo4 {

    public int fib(int n) {

        if(n <= 1){
            return n;
        }
        int a = 0,b = 1;
        int c = 0;

        for(int i = 2;i <= n;i++){
            c = a + b;
            a = b;
            b = c;
        }
        return c;

    }
}
